# -*- coding:utf-8 -*-

__author__ = 'Jason Lee'

import urllib
import qywechat_sdk

# PLATFORM = 'PROD'
# PLATFORM = 'MIRROR'
# PLATFORM = 'TEST'
# PLATFORM = 'DEV'
PLATFORM = 'MY'

if PLATFORM == 'PROD':
    corpid = 'wx6b7b3270008d7aee'
    corpsecret = 'fgp7GIQ8SjElYxluRJeIphhXFCWR9_xTgEHn14jmVPl80lmepmJ4TjO7n3V9U5wf'
    base_url = 'http://isleep.16care.com'
    sleep_id = 2
    agent_id = 4
    helper_id = 0
    doctor_id = 8
    statistic_id = 9
    forum_id = 10
    packet_id = 16
elif PLATFORM == 'MIRROR':
    corpid = 'wx005500832f6345ef'
    corpsecret = 'Uop8xPoakUog-qpAMH4RYBJSRr9O78_CJs9qbCBcsnsVrcIOIRiRV30ZFlMPnDKZ'
    base_url = 'http://mirror.16care.com'
    sleep_id = 1
    agent_id = 2
    helper_id = 0
    doctor_id = 3
    statistic_id = 4
elif PLATFORM == 'TEST':
    #corpid = 'wx75874a40af81412b'
    #corpsecret = 'UC_Yl8zLvGQx-gNS-08bbp2yr67mBiKckvmeP4XtM2FN65MiJlkYpU09ejWwzEqN'
    corpid = 'wxe174b3daf0872585'
    corpsecret = 'TzIerL1QLZjZhfQUx_XeJzTzMXaX2aj89TvQpB1em9dkum0-qPQ4Bv7Gc9EUvyoh'
    base_url = 'http://test.16care.com'
    sleep_id = 1
    agent_id = 2
    helper_id = 0
    doctor_id = 3
    statistic_id = 4
    forum_id = 6
    packet_id = 10
elif PLATFORM == 'DEV':
    #corpid = 'wx03db59ab2dc9e0ab'
    #corpsecret = 'AVRRurXnhdYSkkqAeZdVQrNUdEYJxLg08kD0vxJfFpw2xAGqdhNkKCR6ZAIYFlrZ'
    corpid = 'wxbecf1dc8a75d049f'
    corpsecret = 'bUUsLZh2cvTCZac4NSR96QCFvLtccpYKpR8F-hyhtJSWSTJ8sP3h8iu4S1fQBOF5'
    base_url = 'http://dev.16care.com'
    sleep_id = 1
    agent_id = 2
    helper_id = 0
    doctor_id = 4
    statistic_id = 5
    forum_id = 6
    packet_id = 8
else:
    corpid = 'wxbd8241f1b38aede8'
    corpsecret = 'B_iO6fMbCnhNgND2MrltRx8SEDChlaPnhJ3nN03SfKAkemWCnRyGJK1NWdiwZETP'
    base_url = 'http://liuck.ersoft.cn'
    helper_id = 0
    sleep_id = 5
    doctor_id = 2
    agent_id = 3
    statistic_id = 4
    forum_id = 5
    packet_id = 6
    knb_id = 11


STRUCT = {
    'appid': corpid,
    'appsecret': corpsecret,
    'base_url_unquote': base_url,
    'base_url': urllib.quote_plus(base_url),
    'sleep_id': sleep_id,                           #睡眠专家
    'agent_id': agent_id,                           #医药代表
    'doctor_id': doctor_id,                         #医生社区
    'helper_id': helper_id,                         #企业小助手
    'statistic_id': statistic_id,                    #运营统计
    'forum_id': forum_id,                             #脑血管论坛
    'packet_id': packet_id,                             #摇一摇
    # 'knb_id': knb_id                                #康恩贝活动
}

if __name__ == '__main__':
    sleep_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['sleep_id'])
    # doctor_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['doctor_id'])
    # agent_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['agent_id'])
    helper_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['helper_id'])
    # statistic_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['statistic_id'])
    # forum_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['forum_id'])
    # packet_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['packet_id'])
    # knb_wx = qywechat_sdk.WeChatEnterprise(corpid=STRUCT['appid'], corpsecret=STRUCT['appsecret'], agentid=STRUCT['knb_id'])
    
    
    sleep_menu_dict = {
            'button':[
                {
                    'type':'view',
                    'name':'量表日志',
                     'url':STRUCT['base_url_unquote']+'/isleep/patient/health/report'
                     # 'url':'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fisleep%2fpatient%2fhealth%2freport%26applicationid%3d'+str(STRUCT['sleep_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                },
                {
                    'type': 'view',
                    'name': '我的患者',
                    'url': STRUCT['base_url_unquote']+'/eroad_bracelet/doctor/patient_json_list'
                    # 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fpatient_json_list%26applicationid%3d'+str(STRUCT['sleep_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                },
                {
                    'type':'view',
                    'name':'邀请患者',
                    'url':STRUCT['base_url_unquote']+'/isleep/doctor/invite/patient'
                    # 'url':'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fisleep%2fdoctor%2finvite%2fpatient&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                }
                # {
                #     'name': '更多',
                #     'sub_button': [
                #         {
                #             'type': 'view',
                #             'name': '易米',
                #             'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fred_packet%26applicationid%3d'+str(STRUCT['sleep_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                #         },
                #         {
                #             'type': 'view',
                #             'name': '职业信息',
                #             'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fmine%26applicationid%3d'+str(STRUCT['sleep_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                #         },
                #         {
                #             'type': 'view',
                #             'name': '提出反馈',
                #             'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2ffeedback%26applicationid%3d'+str(STRUCT['sleep_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                #         }
                #
                #     ]
                # }
            ]}
    
    # doctor_menu_dict = {
    #         'button':[
    #             # {
    #             #     'type': 'view',
    #             #     'name': '名医讲堂',
    #             #     'url':STRUCT['base_url_unquote']+'/eroad_bracelet_web_json/static/f7/patientlist/auditorium/index.html'
    #             #     # 'url':STRUCT['base_url_unquote']+'/eroad_bracelet/doctor/video'
    #             #     # 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet_web_json%2fstatic%2fdoctor_halllist%26applicationid%3d'+str(STRUCT['doctor_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #             # },
    #             # {
    #             #     'type': 'view',
    #             #     'name': '科学文献',
    #             #     'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fisleep%2fscience_literature%26applicationid%3d'+str(STRUCT['doctor_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #             # }
    #             {
    #                 'type': 'view',
    #                 'name': '学术资料',
    #                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad%2fdoctor%2fzone%26applicationid%3d'+str(STRUCT['doctor_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #             },
    #             {
    #                 'type': 'view',
    #                 'name': '学术活动',
    #                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad%2fdoctor%2factivity%26applicationid%3d'+str(STRUCT['doctor_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #             },
    #             {
    #                 'type': 'view',
    #                 'name': '收藏',
    #                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad%2fdoctor%2fcollect%26applicationid%3d'+str(STRUCT['doctor_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #             }
    #         ]}
    
    # agent_menu_dict = {
    #                 'button':[
    #                     {
    #                         'name': '医生管理',
    #                         'sub_button': [
    # #                            {
    # #                                'type': 'view',
    # #                                'name': '二维码邀请',
    # #                                'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2finvite%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    # #                            },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '邀请医生',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2finvite_doctor%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '我的医生',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2fdoctor_json_list%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             }
    #                         ]
    #                     },
    #                     {
    #                         'name': 'e康工具',
    #                         'sub_button': [
    #                             {
    #                                 'type': 'view',
    #                                 'name': '印刷名片',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2fnamecard%2fselector%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '日程管理',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fisleep%2fagent%2fschedule&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             }
    #                         ]
    #                     },
    #                     {
    #                         'name': '我的',
    #                         'sub_button': [
    #                             {
    #                                 'type': 'view',
    #                                 'name': '个人排行',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fagent%2fpersonal%2franking%2fselector&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '团队排行',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fagent%2fteam%2franking%2fselector&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '易米',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2fred_packet%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '提出反馈',
    #                                 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2ffeedback%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                             },
    #                             {
    #                                 'type': 'view',
    #                                 'name': '使用帮助',
    #                                 'url': STRUCT['base_url_unquote']+'/eroad_bracelet/agent/help'
    #                             }
    #                         ]
    #                      }
    #                 ]}
    
    helper_menu_dict = {
                    'button':[
    #                    {
    #                        'type': 'view',
    #                        'name': '使用帮助',
    #                        'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fagent%2fhelp%26applicationid%3d'+str(STRUCT['helper_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #                    },
                        {
                            'type': 'view',
                            'name': '注册认证',
                            'url': STRUCT['base_url_unquote']+'/eroad_bracelet/doctor/identify'
                            # 'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fidentify%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                        },
                        {
                            'type': 'view',
                            'name': '认证好处',
                            'url':  STRUCT['base_url_unquote']+'/eroad_bracelet/doctor/identify/benefit'
                            # 'url':  'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fidentify%2fbenefit%26applicationid%3d'+str(STRUCT['agent_id'])+'&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
                        },
                        {
                            'type': 'view',
                            'name': '使用帮助',
                            'url': STRUCT['base_url_unquote']+'/eroad_bracelet/doctor/agent/help'
                        }
                    ]}
    
    # statistic_menu_dict = {
    #     'button':[
    #         {
    #             'type': 'view',
    #             'name': '查看统计',
    #             'url': STRUCT['base_url_unquote']+'/eroad_bracelet_web_json/static/statistics/stindex.html'
    #         }
    #     ]}
    #
    # knb_menu_dict = {
    #     'button':[
    #         {
    #             'type': 'view',
    #             'name': '摇红包',
    #             'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8a4ce6da00bc9886&redirect_uri=mazh.ersoft.cn%2fqywx%2findex%3fredirect%3d%2fisleep%2fdoctor%2fshake%2fprize&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #         }
    #     ]}
    #
    # forum_menu_dict = {
    #     'button':[
    #         {
    #             'type': 'click',
    #             'name': '精彩回顾',
    #             'key': 'STAY_GUIDE'
    #         },
    #         {
    #             'name': '大会信息',
    #             'sub_button': [
    #                 {
    #                     'type': 'click',
    #                     'name': '大会概览',
    #                     'key': 'MEETING_OVERVIEW'
    #                 },
    #                 {
    #                     'type': 'click',
    #                     'name': '组织架构',
    #                     'key': 'ORGANIZATION'
    #                 },
    #                 {
    #                     'type': 'click',
    #                     'name': '大会日程',
    #                     'key': 'MEETING_SCHEDULE'
    #                 },
    #                 {
    #                     'type': 'click',
    #                     'name': '学分信息',
    #                     'key': 'CREDIT_INFO'
    #                 }
    #             ]
    #         }
    #         # {
    #         #     'type': 'click',
    #         #     'name': '大会日程',
    #         #     'key': 'MEETING_SCHEDULE'
    #         # },
    #         # {
    #         #     'name': '大会体验',
    #         #     'sub_button': [
    #         #         {
    #         #             'type': 'view',
    #         #             'name': '注册报名',
    #         #             'url': 'http://www.hdb.com/party/mj8v'
    #         #         },
    #         #         {
    #         #             'type': 'click',
    #         #             'name': '签到须知',
    #         #             'key': 'SINGN_NOTICE'
    #         #         },
    #         #         {
    #         #             'type': 'click',
    #         #             'name': '交通指南',
    #         #             'key': 'TRAFFIC_GUIDE'
    #         #         },
    #         #         {
    #         #             'type': 'click',
    #         #             'name': '住宿指南',
    #         #             'key': 'STAY_GUIDE'
    #         #         }
    #         #     ]
    #         # }
    #     ]}
    # packet_menu_dict = {
    #     'button':[
    #         {
    #             'type': 'view',
    #             'name': '摇一摇',
    #             'url': 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='+STRUCT['appid']+'&redirect_uri='+STRUCT['base_url']+'%2fqywx%2findex%3fredirect%3d%2fagent%2fshake%2fred%2fpacket&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    #         }
    #     ]}
    
    #print '====sleep_nemu_dict:', sleep_menu_dict
    res = sleep_wx.create_menu(sleep_menu_dict)
    print res
    
    #print '====doctor_nemu_dict:', doctor_menu_dict
    # res = doctor_wx.create_menu(doctor_menu_dict)
    # print res
    
    #print '====agent_nemu_dict:', agent_menu_dict
    # res = agent_wx.create_menu(agent_menu_dict)
    # print res
    
    # print '====helper_nemu_dict:', helper_menu_dict
    res = helper_wx.create_menu(helper_menu_dict)
    print res
    
    # print '====statistic_nemu_dict:', statistic_menu_dict
    # res = statistic_wx.create_menu(statistic_menu_dict)
    # print res
    
    # res = forum_wx.create_menu(forum_menu_dict)
    # print res
    
    # res = packet_wx.create_menu(packet_menu_dict)
    # print res
    
    # res = knb_wx.create_menu(knb_menu_dict)
    # print res
    
    print 'finished'
    
    
    #线上菜单备份
    ##医生
    ###患者：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fpatient_json_list%26applicationid%3d7&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    ###名医讲堂：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet_web_json%2fstatic%2fdoctor_halllist%26applicationid%3d2&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    ###我的--职业信息：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fdoctor%2fmine%26applicationid%3d2&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    
    ##代表
    ###医生：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2fdoctor_json_list%26applicationid%3d4&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    ###印刷名片：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2fnamecard%2fselector%26applicationid%3d4&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    ###邀请医生：https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=http%3a%2f%2fisleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad_bracelet%2fagent%2finvite%26applicationid%3d4&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    #医生个人中心
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8a4ce6da00bc9886&redirect_uri=mazh.ersoft.cn%2fqywx%2findex%3fredirect%3d%2fisleep%2fget%2fdoctor%2finfo&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=isleep.16care.com%2fqywx%2findex%3fredirect%3d%2feroad%2fdoctor%2fzone&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=isleep.16care.com%2fqywx%2findex%3fredirect%3d%2fisleep%2fdoctor%2fshake%2fprize&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    
    #医药代表个人中心/agent/community/home
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8a4ce6da00bc9886&redirect_uri=mazh.ersoft.cn%2fqywx%2findex%3fredirect%3d%2fagent%2fcommunity%2fhome&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect'
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=isleep.16care.com%2fqywx%2findex%3fredirect%3d%2fagent%2fcommunity%2fhome&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
    # https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6b7b3270008d7aee&redirect_uri=isleep.16care.com%2fqywx%2findex%3fredirect%3d%2fagent%2fcommunity%2fhome&response_type=code&scope=snsapi_userinfo&state=test1#wechat_redirect
